-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/RegistrationGameStyles #85
base: develop
Are you sure you want to change the base?
Conversation
src/features/register-player/player-registration/FormStepOne.tsx
Outdated
Show resolved
Hide resolved
✅ Deploy Preview for temvagamestre ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
}, | ||
}) | ||
|
||
function onSubmit(data: FormGameStylesType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nao entendi essa função, porque ela ta aqui?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nao entendi essa função, porque ela ta aqui?
Creio que isso tenha sido feito enquanto eu estava construindo ainda. O final tem tudo isso, só o componente com o seu custom hook, e o formulário relacionado.
src/components/ui/checkbox.tsx
Outdated
<CheckboxPrimitive.Root | ||
ref={ref} | ||
className={cn( | ||
"peer h-4 w-4 shrink-0 rounded-sm border border-slate-900 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=checked]:text-slate-50 dark:border-slate-50 dark:ring-offset-slate-950 dark:focus-visible:ring-slate-300 dark:data-[state=checked]:bg-slate-50 dark:data-[state=checked]:text-slate-900", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Como foi bastante alteração de estilo, uma dica pra ficar mais fácil a manutenção é separar/dividir tudo isso, como por exemplo:
const baseClasses = "peer h-4 w-4 shrink-0 rounded-sm border ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:ring-offset-slate-950";
const stateClasses = "data-[state=checked]:bg-slate-900 data-[state=checked]:text-slate-50 dark:data-[state=checked]:bg-slate-50 dark:data-[state=checked]:text-slate-900";
const borderClasses = "border-slate-900 dark:border-slate-50";
const focusClasses = "focus-visible:ring-slate-950 dark:focus-visible:ring-slate-300";
className={cn(
baseClasses,
borderClasses,
focusClasses,
stateClasses,
className
)}
<Form {...form}> | ||
<div> | ||
<FormAditionalText className='text-center'> | ||
Olá! Para aprimorarmos sua experiência no TVM, por favor, responda |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essas partes de textos estáticos poderia ser colocada em um json, facilita a manutenção.
Algo como:
{ "formGameStyles": { "additionalText": "Olá! Para aprimorarmos sua experiência no TVM, por favor, responda algumas perguntas.", "title": "Escolha o estilo de jogo que mais se alinha com seus interesses." } }
isLoading, | ||
error, | ||
} = useFetchData<GameStyle[]>( | ||
'https://tem-vaga-mestre-api-nnf7bytugq-uc.a.run.app/rpg-style', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passar isso pra env, pra melhor manutenção, flexibilidade e segurança
process.env.REACT_APP_RPG_STYLE_API_URL
const response = await fetch(`https://tem-vaga-mestre-api-nnf7bytugq-uc.a.run.app/user/check-username/${username}`) | ||
return response.status === 200 ? true : false | ||
const response = await fetch( | ||
`https://tem-vaga-mestre-api-nnf7bytugq-uc.a.run.app/user/check-username/${username}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passar pra env
…ed a small issue with radix version
…bility in alert-dialog
…bility in radio-group
…bility in textarea
…ch that leaked throgh
Adicionados funções referentes a tarefa de cadastro de estilos de jogo referente a tarefa #107 do Taiga
Adicional